//
//  UIStandardEditTableViewCell.m
//  vhECGTools
//
//  Created by jia yu on 2022/8/19.
//

#import "UIStandardEditTableViewCell.h"
#import <vhECGTools/vhECGTools.h>
@interface UIStandardEditTableViewCell(){
    float scale;
    UILabel *label;
}
@end

@implementation UIStandardEditTableViewCell
@synthesize text;

-(void)setText:(NSString *)_text{
    text = _text;
    label.text = [@"•  " stringByAppendingString:text];
}

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier withScale:(float)_scale{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self){
        scale = _scale;
        
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0.f, 0.f, self.frame.size.width, self.frame.size.height)];
        view.layer.cornerRadius = 10.f * scale;
        view.layer.masksToBounds = YES;
        view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        view.backgroundColor = [vhECGTools colorFromHEXString:@"edf7f8"];
        self.selectedBackgroundView = view;
        
        float labelHeight = 40.f * scale;
        label = [[UILabel alloc] initWithFrame:CGRectMake(15.f * scale, (self.frame.size.height-labelHeight)/2.f, self.frame.size.width-15.f*scale, labelHeight)];
        label.autoresizingMask = UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin|UIViewAutoresizingFlexibleWidth;
        label.font = [UIFont fontWithName:@"PingFangSC-Regular" size:34.f * scale];
        label.textColor = [vhECGTools colorFromHEXString:@"294559"];
        [self addSubview:label];
    }
    return self;
}

@end
